package com.yznote.compileserver.yCompile.io;

import com.yznote.compileserver.yCompile.result.YResult;
import com.yznote.compileserver.yCompile.result.YResultType;

import java.io.IOException;

public class YResultOutPut implements YOutPut{
    private YResult yResult;
    public YResultOutPut(YResult yResult){
        this.yResult = yResult;
    }
    @Override
    public void writeType(YResultType yResultType) {
        yResult.setYResultType(yResultType);
    }

    @Override
    public void writeOut(String out) {
        yResult.setOut(out);
    }

    @Override
    public void writeTimes(long timeout) {
        yResult.setTimes(timeout);
    }

    @Override
    public void close() throws IOException {
       this.yResult = null;
    }
}
